﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Manage/MasterPage.master" AutoEventWireup="true" CodeFile="Member_Mode.aspx.cs" Inherits="Manage_Member_Mode" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        #menber_table
        {
            width: 99%;
            border-collapse: collapse;
            empty-cells: show;
            margin-left: 8px;
            margin-top: 10px;
            margin-bottom: 20px;
        }
        #menber_table tr
        {
            height: 35px;
            background: #f6f6f6;
        }
        #menber_table tr td
        {
            border: #d8d8d8 1px solid;
            vertical-align: middle;
        }
        #menber_table tr .td1
        {
            width: 110px;
            text-align: right;
            padding-right: 15px;
        }
        #menber_table tr .td2
        {
            padding: 15px;
        }
        #menber_table tr .td2 .tinput
        {
            height: 25px;
            width: 300px;
            font-size: 18px;
        }
        #type_m label {
            margin-right:30px; padding:5px;
        }
        .checkimg{ margin-bottom:-2px; margin-right:5px; margin-left:25px;}
        .start
        {
            color:red;
            font-size:18;
        }
    </style>
    <script type="text/javascript">        var checkuserbool = false;        var issheyuan = false;        function img_error(span_object, imgbool, message) {
            //错误信息提示
            var imgspan = span_object;
            var img_Uname_src = imgspan.find(".checkimg")[0];
            if (imgbool == true) {
                img_Uname_src.src = '<%=ResolveUrl("~/images/access_allowu.gif")%>';
            }
            else {
                img_Uname_src.src = '<%=ResolveUrl("~/images/check_error.gif")%>';
            }
            imgspan.find(".checkspan").text(message);
            imgspan.show();
        }        var check_issheyuan=function()        {
            //验证是否社员
            if (issheyuan) {
                jQuery(".nsheyuan").hide();
                jQuery(".sheyuan").show();
            }
            else
            {
                jQuery(".nsheyuan").show();
                jQuery(".sheyuan").hide();
            }
        }        var radio_change = function () {
            //类型变更,方法
            if (jQuery("input[type='radio']:checked").val() == "2") {
                issheyuan = true;
            }
            else {
                issheyuan = false;
            }
            check_issheyuan();        }        var check_M_type=function()        {
            //验证类型
            if(jQuery("input[type='radio']:checked").val()==undefined||jQuery("input[type='radio']:checked").val()==null)
            {
                alert("请选择类型");
                return false;
            }
            return true;
        }        var check_Name = function () {
            //验证姓名
            if (jQuery("[id$=Name]").val().length < 1) {
                img_error(jQuery("#cname"), false, "请输入姓名");
                return false;
            }            img_error(jQuery("#cname"), true, "");            return true;        }        var check_StuID = function () {
            //验证学号
            if (jQuery("[id$=StuID]").val().length < 1) {
                img_error(jQuery("#cstuid"), false, "请输入学号");
                return false;
            }
            img_error(jQuery("#cstuid"), true, "");            return true;
        }        var check_ZhiWu = function () {
            //验证职务
            if (jQuery("[id$=ZhiWu]").val().length < 1) {
                img_error(jQuery("#czhiwu"), false, "请输入职务");
                return false;
            }            img_error(jQuery("#czhiwu"), true, "");            return true;
        }        var check_M_RX_Year = function () {
            //验证入学年份
            if (jQuery("[id$=M_RX_Year] option:selected").text() == "入学年份") {
                img_error(jQuery("#crxyear"), false, "请选择入学年份");
                return false;
            }            img_error(jQuery("#crxyear"), true, "");            return true;
        }        var check_M_RZ_Year = function () {
            //验证任职年份
            if (jQuery("[id$=M_RZ_Year] option:selected").text() == "任职年份") {
                img_error(jQuery("#crzyear"), false, "请选择任职年份");
                return false;
            }            img_error(jQuery("#crzyear"), true, "");            return true;
        }                var check_M_Class = function () {
            //验证班级
            if (jQuery("[id$=M_Class]").val().length < 1) {
                img_error(jQuery("#cclass"), false, "请输入班级");
                return false;
            }            img_error(jQuery("#cclass"), true, "");            return true;
        }        var check_submit = function () {
            var boolsubmit;
            check_Name();
            
            check_M_RX_Year();
            
            check_M_Class();
            
            if (issheyuan)
            {
                check_StuID();
                boolsubmit = check_M_type() && check_Name() && check_StuID() && check_M_RX_Year() && check_M_Class();
            }
            else
            {
                check_M_RZ_Year();
                check_ZhiWu();
                boolsubmit =check_M_type()&& check_Name() && check_ZhiWu() && check_M_RX_Year() && check_M_RZ_Year() && check_M_Class();
            }
            return boolsubmit;
        }        jQuery(document).ready(            function()            {
                radio_change();
                jQuery("[id$=Name]").focusout(check_Name);
                jQuery("[id$=ZhiWu]").focusout(check_Name);
                jQuery("[id$=M_RX_Year]").change(check_M_RX_Year);
                jQuery("[id$=M_RZ_Year]").change(check_M_RZ_Year);
                jQuery("[id$=M_Class]").focusout(check_M_Class);
                jQuery("[id$=M_type]").change(
                    function () {
                        radio_change();
                    });
            }         );    </script></asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<table id="menber_table">
   <tr style=" height:25px; background:url('images/tt_x.gif') repeat-x;">
     <td colspan="5" style=" padding-left:8px;">
         <asp:Label runat="server" ID="PageTitle"></asp:Label>
     </td>
   </tr>
    <tr>
        <td  class="td1">类型：</td>
        <td  class="td2" id="type_m">
            <asp:RadioButtonList runat="server" ID="M_type" RepeatLayout="Flow" RepeatDirection="Horizontal" >
                <asp:ListItem Value="0">干部</asp:ListItem>
                <asp:ListItem Value="1">干事</asp:ListItem>
                <asp:ListItem Value="2">社员</asp:ListItem>
            </asp:RadioButtonList>
            <span class="start">*必填</span>
        </td>
    </tr>
    <tr>
        <td  class="td1">姓名：</td>
        <td  class="td2">
            <asp:TextBox ID="Name" runat="server" CssClass="tinput"></asp:TextBox>
            <span class="start">*必填</span>
              <span id="cname" style=" display:none;">
                 <img src=''  alt="" class="checkimg"/><span class="checkspan"></span>
              </span>
        </td>
    </tr>
    <tr class="sheyuan">
        <td class="td1">
            学号
        </td>
        <td class="td2">
            <asp:TextBox ID="StuID" runat="server" CssClass="tinput"></asp:TextBox>
            <span class="start">*必填</span>
              <span id="cstuid" style=" display:none;">
                 <img src=''  alt="" class="checkimg"/><span class="checkspan"></span>
              </span>
        </td>
    </tr>
    <tr class="nsheyuan">
        <td  class="td1">职务：</td>
        <td  class="td2">
            <asp:TextBox ID="ZhiWu" runat="server" CssClass="tinput"></asp:TextBox>
            <span class="start">*必填</span>
            <span id="czhiwu" style=" display:none;">
                 <img src=''  alt="" class="checkimg"/><span class="checkspan"></span>
            </span>
        </td>
    </tr>
    <tr>
        <td  class="td1">入学年份：</td>
        <td  class="td2">
            <asp:DropDownList ID="M_RX_Year" runat="server" >
                </asp:DropDownList>
            <span class="start">*必填</span>
              <span id="crxyear" style=" display:none;">
                 <img src=''  alt="" class="checkimg"/><span class="checkspan"></span>
              </span>
        </td>
    </tr>
    <tr class="nsheyuan">
        <td  class="td1">任职年份：</td>
        <td  class="td2">
            <asp:DropDownList ID="M_RZ_Year" runat="server">
                </asp:DropDownList>
            <span class="start">*必填</span>
              <span id="crzyear" style=" display:none;">
                 <img src=''  alt="" class="checkimg"/><span class="checkspan"></span>
              </span>
        </td>
    </tr>
    <tr>
        <td  class="td1">电话：</td>
        <td  class="td2">
            <asp:TextBox ID="Phone" runat="server" CssClass="tinput"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td  class="td1">短号：</td>
        <td  class="td2">
            <asp:TextBox ID="Short" runat="server" CssClass="tinput"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td  class="td1">宿舍地址：</td>
        <td  class="td2">
            <asp:TextBox ID="Address" runat="server" CssClass="tinput"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td  class="td1">班级：</td>
        <td  class="td2">
            <asp:TextBox ID="M_Class" runat="server" CssClass="tinput"></asp:TextBox>
            <span class="start">*必填</span>
            <span id="cclass" style=" display:none;">
                 <img src=''  alt="" class="checkimg"/><span class="checkspan"></span>
            </span>
        </td>
    </tr>
      <tr>
            <td class="td1">
            </td>
            <td class="td2">
                <asp:Button ID="submit" runat="server" Text="添加" Style="float: right; width:200px;"  OnClientClick="return check_submit()" />
            </td>
        </tr>
 </table>
</asp:Content>

